package com.itheima.mapper;

import com.itheima.pojo.Student;
import com.itheima.pojo.StudentQueryParam;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentMapper {
    List<Student> list(StudentQueryParam studentQueryParam);

    int insert(Student student);

    Student getStudentInfoById(Integer id);

    void updateById(Student student);

    int deleteBatch(List<Integer> ids);

    int updateViolation(@Param("id") Integer id,@Param("score") Short score);

    @MapKey(value = "name")
    List<Map> countStudentDegreeData();

    @MapKey(value = "name")
    List<Map<String, Object>> countStudentCountData();

    int countClazzStudents(@Param("ids") List<Integer> ids);

}
